package com.kokomi.direct_model;


import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 生产者
 * 测试定向模型，特定队列才能接到消息
 */
@RestController
public class DirectProducer {


    @Autowired
    private RabbitTemplate rabbitTemplate;


    @GetMapping("/directModel")
    public ResponseEntity<?> directModel() {
        String msg = "定向模型- 一生产 对应 多队列 对应 多消费";
        rabbitTemplate.convertAndSend("direct_exchange", "gz", msg);
        return ResponseEntity.ok("定时模型发送成功");
    }



}
